﻿package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

	//第一次修改hahaasdsada
	//第二次修改
	//第三次修改
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2017091908814766";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
	//ewqeqweqwe
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCTNUF4bQj42UnSqeeK1gnozmbdi9ieaGyWF9ZciS/TjzufwBJkFEpniNvPr83yzD4d9xIX3q8C0ClArBe6w+/97BCgG9N/Wqt4AnpMUTMlh4ge2mDjog6LZtkE9su1Xtif3NXFW08mzxHTdmXnGAXIqE4KiSi2zrnP7YIdUOf39k8+8o3UZvnjhMs1c1bow+kQYM9twDvF8iNgdk8cdgxL958XpBtHkTWWzvXCltymVqFqV8qYEpMhWUHFwoK4hgSzaODs7PbYFJ58NArw2WtT1ZSfWrgu1C1unDVMadyRS/tNMOQKE4vIen2BYOlXM0T2Q+2TbHwnVqERCNJ6WWbHAgMBAAECggEAdmaXSi0o0j6yyeYufdS6E64vvnIEwSRsciyqFbOh7B+AbXUnVaecULobUmis1WTBcYiP3PMXAMQ86e+BBo8iMLH2jVDUQ9LBp70WcNu+r6jbKzWqSGzIFgea9gsqva6TvcD5j8tpVmWmiNbqD32a6VG1s3Ouc5rCiSMXTE0Oxrj0/4kXgavHMnKO+0HYwIdXC7xpY7aK6nQUnBYe0Xihj+to0gVEOx4eHcgXEJkKxfbQ6e5AAI37CB8LyYdvNoCDRF+kQJ8vnZEqQ6oSamQ0T2RF9+EPicClKBLmek8EDOTN82KMyKtxFLxy3EZskg+c06M9YgBXAGCOIOvYrZXUgQKBgQDPUafksrJgjz1PmVzvFonD+83+cnhRNjGZABvALpGKUCsOSFk7qDVClI15L36S/UvYvkHkjM9qqiPCmwhMI1OniQMsa7ahvdl1F+TQ2d6u+Mdcv0a/NkY8N5pOFiDE4gljvBw+lyG+IeHB8p8mRXQBemr+ephq/CaoWeOmyaaNmQKBgQC1xjcVZolQGcI2HOs4hqiG+VwgM5Qm2yGPYzcwNWJWMand3fL/UwqMB8gWY4nqUh7+ITr0Yux13owAqPGm/lVSnOHCLfkjbPvBSDygNi9PR2StnhJ1ym98sTzPkHmCyEbuA04R1QvdbJASCkNeyc+CaMU7ETltwERgXfgEIZyTXwKBgFWd+kEnTyUzYnWR92BBpYlLXynaqjeXsunlspAuayp8qxtN45QQhlZFtRs78wDPHFiZUesJ/8qkEvqWPdn7qNuCaM4aeaTYG4sQ4A0kPKNz2BlEYPosdtr9d3sSBlxooMoQcHWkwmmb4njPMsyCWEMYBEGt7W4ZTfmujaZelqrZAoGBAKFKiIYMvbq9oH6zmmRF2DQr/3rzSXpQ5q58svOr6t3go4Gi94NnA+zM2tZC7JVm2OlWQyGmxXqxRjkvr30mID91xTyv3ml4wsr2dhUS/1exWbxUjrzGK7bQ7cyfvbI2U/nOJO/dwvFu60eWo8DwAZkNrjSDTBn+iK2ZtAC2cmCxAoGBALItm9E3UNHdl9QLV8fcXo6/nec2V9KT0iezYLU2zkgeQOeLCl7jCum9KyR4AzQMKg9N7RBt+Yn8TWg4bZFvfNW+pTv+ClkoFANvlKeIGN7Dln87pg/PgU3753gwT2WBdAw4TAc5W+pdMsc2ryiGyJSrFZAJTnfunkd0xW5QDL2j";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArtRexzkZGXnqPgAOK96aynrHnn0mpTLjAAQEmMjzfwAgcfo+01x7NEguHysp+3P3cNy/isKcpyiNxerxSAGY7iliLfYMQu3MOAnnZjXOSokUyEmp0n7BeBgMKdHGUvMwFt9X5ysxN/9x/xAzU/NM/tjJWhHdt6/skbaewVyJZ5284TA4HtnBtkKJLANjM7ar2OhDWx4jqDqYTOnaZlCwh4tFOCQNzIdNqXmJbuqkLV/7HAC3vqaqbggev1dwbW9K7Gkb/qi1GZKofGMpPG/vIXbeu5uKkbl/70EFBqw+bezJP0tD47gL+nf5TawCoOXkj+5tCNtUQNg8HFWkZSOucwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
	
	// 支付宝网关
	//哈哈
	public static String log_path = "C:\\";

//第二次修改
//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

